#include "systemfailureview.h"

SystemFailureView::SystemFailureView(QWidget *parent)
    : QWidget{parent}
{
    setUI();
}

void SystemFailureView::setUI()
{
    gridLayout = new QGridLayout();
    gridLayout->setSpacing(0);
    gridLayout->setContentsMargins(0, 0, 0, 0);
    QList <QString> list,colorList;
    colorList<< "stationbtn"<< "stationbtn"<< "rUNiLeftDbtn"<< "rUNiRightDbtn"<< "systemFailureBtn"<< "systemFailureBtn"<< "systemFailureBtn"<< "systemFailureBtn"<< "systemFailureBtn"<< "systemFailureBtn"<< "stationbtn"<< "stationbtn";
    list<<"下一站:\n"<<"终点站:\n"<<""<<""<<""<<""<<""<<""<<""<<""<<""<<"";
    for (int i = 0; i < 12; i++){
        pushButton[i] = new QPushButton();
        pushButton[i]->setText(list[i]);
        pushButton[i]->setObjectName(colorList[i]);
        /* 自动调整按钮的大小 */
        pushButton[i]->setSizePolicy(
            QSizePolicy::Expanding,
            QSizePolicy::Expanding
            );

        gridLayout->addWidget(pushButton[i], i/2, i%2);
    }


    /* 将 gridLayout 设置到 gWidget */
    setLayout(gridLayout);
}
